Skip to content

Conversation

boomanaiden154
Copy link
Contributor

This patch adds a %T substitution directly into the libc++ test format.
This ensures that the libc++ test format will continue to work when we
remove support for %T in llvm lit.

Created using spr 1.3.6
@boomanaiden154 boomanaiden154 requested a review from a team as a code owner September 22, 2025 03:50
@llvmbot llvmbot added the libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi. label Sep 22, 2025
@llvmbot
Copy link
Member

llvmbot commented Sep 22, 2025

@llvm/pr-subscribers-libcxx

Author: Aiden Grossman (boomanaiden154)

Changes

This patch adds a %T substitution directly into the libc++ test format.
This ensures that the libc++ test format will continue to work when we
remove support for %T in llvm lit.


Full diff: https://github.com/llvm/llvm-project/pull/160026.diff

1 Files Affected:

  • (modified) libcxx/utils/libcxx/test/format.py (+1)
diff --git a/libcxx/utils/libcxx/test/format.py b/libcxx/utils/libcxx/test/format.py
index 5765afec399cf..c9dffd1bb7971 100644
--- a/libcxx/utils/libcxx/test/format.py
+++ b/libcxx/utils/libcxx/test/format.py
@@ -92,6 +92,7 @@ def parseScript(test, preamble):
     #       errors, which doesn't make sense for clang-verify tests because we may want to check
     #       for specific warning diagnostics.
     _checkBaseSubstitutions(substitutions)
+    substitutions.append(("%T", tmpDir))
     substitutions.append(
         ("%{build}", "%{cxx} %s %{flags} %{compile_flags} %{link_flags} -o %t.exe")
     )

@boomanaiden154
Copy link
Contributor Author

I'm going to land this given all the CI is passing (minus the flaky arm bots) and that it is pretty trivial. If there is any postcommit followup needed, please let me know and I'll address any comments there.

I want to get this in reasonably soon to ensure we don't backslide on having %T used in the repository.

@boomanaiden154 boomanaiden154 merged commit 37e7ad1 into main Sep 26, 2025
75 of 80 checks passed
@boomanaiden154 boomanaiden154 deleted the users/boomanaiden154/libcxx-add-local-t-substitution branch September 26, 2025 22:48
llvm-sync bot pushed a commit to arm/arm-toolchain that referenced this pull request Sep 26, 2025
This patch adds a %T substitution directly into the libc++ test format.
This ensures that the libc++ test format will continue to work when we
remove support for %T in llvm lit.

Reviewers: #reviewers-libcxx, ldionne, philnik777

Pull Request: llvm/llvm-project#160026
# errors, which doesn't make sense for clang-verify tests because we may want to check
# for specific warning diagnostics.
_checkBaseSubstitutions(substitutions)
substitutions.append(("%T", tmpDir))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest introducing this as %{temp} and documenting it officially as a substitution added by the libc++ testing format instead. Once %T is removed in Lit, this substitution will become seemingly random for anybody who isn't familiar with the current %T substitution provided by Lit.

mahesh-attarde pushed a commit to mahesh-attarde/llvm-project that referenced this pull request Oct 3, 2025
This patch adds a %T substitution directly into the libc++ test format.
This ensures that the libc++ test format will continue to work when we
remove support for %T in llvm lit.

Reviewers: #reviewers-libcxx, ldionne, philnik777

Pull Request: llvm#160026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants